/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package game.experts.combine;

import game.encodings.OutputEncoding;
import utils.Profile;

/**
 *
 * @author emanuele
 */
public class SSPMaximumSingleWeightHintedCombinerExpert extends SSPSingleWeightHintedCombinerExpert {

    @Override
    protected Profile mergePredictions(OutputEncoding[] allPredictions) {
        int imax = 0;
        double currweight, maxweight = 0;
        for (int i = 0; i < allPredictions.length; i++) {
            currweight = this.getWeight(this.experts.get(i));
            if (currweight > maxweight) {
                imax = i;
                maxweight = currweight;
            }
        }
        return allPredictions[imax].getProfile();
    }

}
